package ee.ts022.tuum.services;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import ee.ts022.tuum.dao.CustomerDao;
import ee.ts022.tuum.domain.Contract;
import ee.ts022.tuum.domain.Customer;

@Service
public class CustomerServiceImpl implements CustomerService {

	@Autowired
	private CustomerDao customerDao;
	
	@Transactional
	public List<Customer> getCustomers() {
		return customerDao.getAll();
	}

	@Transactional
	public List<Contract> getCustomerContracts(int customer) {
		return customerDao.getCustomerContracts(customer);
	}

	@Transactional
	public List<Contract> getCustomerContracts(Customer customer) {
		return customerDao.getCustomerContracts(customer);
	}

	@Transactional
	public Customer getCustomer(int customer) {
		return customerDao.get(customer);
	}

}
